package com.sky.mapper;

import com.sky.annotation.AutoFill;
import com.sky.dto.UserLoginDTO;
import com.sky.entity.User;
import com.sky.myenum.OperationType;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.poi.sl.usermodel.StrokeStyle;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface UserMapper {






    @Select("select * from user where openid = #{openId}")
    User selectByOpenId(String openId);

    @AutoFill(OperationType.INSERT)
    void insert(User user);

    @Select("select * from user where id = #{userId}")
    User getById(Long userId);

    @Select("select * from user")
    List<User> selectAll();


    Integer countNews(LocalDateTime start, LocalDateTime end);

}
